<!DOCTYPE html>
<html>

<head>
  <title>纯文本响应测试</title>
</head>

<body>
  <h1>纯文本响应测试</h1>
  <button onclick="testTextResponse()">测试纯文本响应</button>
  <div id="result"></div>

  <script>
    async function testTextResponse() {
      try {
        const response = await fetch('/text');
        const text = await response.text();
        document.getElementById('result').textContent = text;
      } catch (error) {
        document.getElementById('result').textContent = '错误: ' + error.message;
      }
    }
  </script>
</body>

</html>